Repository navigation
Pages per testsuite and testcase, and the roles ':tc:' and ':ts:' - #21
Conversation
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Documentation | 7 minor |
| CodeStyle | 12 minor |
| Complexity | 1 medium 2 minor |
🟢 Metrics 174 complexity · 1 duplication
Metric Results Complexity 174 Duplication 1
🟢 Coverage 92.58% diff coverage · +2.59% coverage variation
Metric Results Coverage variation ✅ +2.59% coverage variation (-1.00%) Diff coverage ✅ 92.58% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (722c7fa) 2619 2020 77.13% Head commit (4861238) 3007 (+388) 2397 (+377) 79.71% (+2.59%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#21) 431 399 92.58% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## dev #21 +/- ##
==========================================
+ Coverage 74.79% 77.02% +2.22%
==========================================
Files 18 19 +1
Lines 2619 3007 +388
Branches 368 437 +69
==========================================
+ Hits 1959 2316 +357
- Misses 599 610 +11
- Partials 61 81 +20
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
9d2f3fb to
091453d
Compare
778bd52 to
492e7fd
Compare
… ':ts:'
A unit test report declared with the new key 'pages' gets a document per
testsuite and per testcase, named '<pages>/<testsuite>/.../<testcase>'.
The pages are built as docutils node trees - no source file is written,
no private parser is called - and handed to Sphinx as if they were read:
their names are registered in 'builder-inited' and again in
'env-before-read-docs', the report file is their source for Sphinx (so a
changed report rebuilds them), 'doctree-read' is emitted for the
environment's collectors, and the doctrees are stored with
'write_doctree'. The HTML builder doesn't copy the report as their source.
* A testcase's page: status, duration, assertions, linked testsuite, the
message and details of a failure/error/skip, captured output.
* A testsuite's page: status, counts, duration, assertions, parent, and
tables of its testsuites and testcases linked to their pages; a hidden
toctree of them. Every page is ':orphan:'.
* Title, summary and description of a report (pyTooling's format) are
shown below the name, as plain text.
* The summary table links a testsuite's or testcase's name to its page.
* Domain 'report' gets the object types 'testsuite'/'testcase', the roles
'ts'/'tc' (also global ':ts:'/':tc:'), 'clear_doc', 'merge_domaindata',
'resolve_xref', 'resolve_any_xref' and 'get_objects'. A target is
'[<report ID>:]<qualified name>' or a unique suffix of it; the default
report is the first one of 'pyTooling_Unittest_Testsuites'.
The reports are read once in 'builder-inited' and shared by the summary
tables and the pages. A report's format is chosen by its root element:
JUnit XML ('<testsuites>'/'<testsuite>') or pyTooling's XML format
('<TestReport>').
Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
…nd ':ts:' The example report is declared with pages, and a report in pyTooling's XML format is added as a second example, so the documentation shows real pages and live references. Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
pyEDAA.Reports #190 renamed 'ErrorOutput' to 'StandardError', as POSIX names the stream. Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
…Windows '_warningLines()' turns '\' into '/' on Windows, the backslash of 'unittests\ut' too. Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
492e7fd to
beedb4e
Compare
The directive 'report:unittest-summary' lists the top-level testsuites of a report with pages in a hidden table of contents. With the testsuite pages listing their children, the hierarchy is in the navigation below the summary's document. A generated page's own sections aren't listed there. As the pages are in the table of contents, LaTeX writes them too. The documentation's navigation has no depth limit, so the example report's testcases are reachable. Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
Note
Stacked on #20 (domain
report): this PR's base isclaude/report-domain. It also needs edaa-org/pyEDAA.Reports#190 and edaa-org/pyEDAA.Reports#191 merged into pyEDAA.Reports'dev, which the extrareportsinstalls; CI fails until then.New Features
pyTooling.Sphinx.UnittestPages(new):A unit test report declared in
pyTooling_Unittest_Testsuiteswith the new keypagesgets a page per testsuite and per testcase, generated at build time without writing source files:<pages>/<testsuite>/.../<testsuite>;<pages>/<testsuite>/.../<testcase>.Unsafe characters in names become
_; colliding names get-2,-3, ...Testcase page: status, duration, assertions (if known), the linked testsuite, the message and details of a failure, error or skip, and the captured standard output and standard error.
Testsuite page: status, counts per status, duration, assertions, parent, and tables of its testsuites and testcases, linked to their pages.
Title, summary and description of a pyTooling report are shown below the name.
Navigation and rebuilds:
report:unittest-summarylists a report's top-level testsuites in a hidden toctree, and a testsuite's page has a hidden toctree of its children, so the hierarchy is in the navigation (sidebar and breadcrumbs) below the summary's document. A generated page's own sections (Summary, Testcases, ...) aren't listed in the navigation.:orphan:, so a report with pages but without a summary directive causes no warnings.The pages are built as docutils node trees, so the private
_parse_str_to_doctreeisn't needed, and report text needs no escaping into ReST.pyTooling.Sphinx:ReportDomaingets content:testsuiteandtestcase;:report:ts:and:report:tc:, also registered as:ts:and:tc:;clear_doc,merge_domaindata,resolve_xref,resolve_any_xrefandget_objects, which puts the objects intoobjects.invas<report ID>:<qualified name>.New
UnittestEntry,UnittestRole,UNITTEST_ROLES.A target is
[<report ID>:]<qualified name>, or a unique suffix of the qualified name, matched on name boundaries.pyTooling_Unittest_Testsuitesis meant. A prefix counts as a report ID only if it is a configured report, because a pytest parameter ID may contain:.pyTooling.Sphinx.Unittest:<TestReport>), read by Read pyTooling's XML test report format edaa-org/pyEDAA.Reports#191. The format is chosen by the root element, so there is no new configuration key.unittest-summarylinks every testsuite and testcase name to its page when the report has pages.Changes
pyTooling.Sphinx.Unittest:builder-inited, and shared by the summary tables and the pages. Before, each directive re-read its report.ShowTestcasescounts an expected failure as passed and an unexpected pass as failed; ✅ is shown for an expected failure.Documentation
Directives/UnittestSummary.rst:pages;examplereport is declared with pages, and a pyTooling-format example report is added, so the documentation shows real pages and live:tc:/:ts:references.doc/conf.py: the Read the Docs theme'snavigation_depthis unlimited (-1, was 5), so the example report's testcases - seven levels below the summary - are in the navigation. The page Pages per testsuite and testcase says how a theme's depth limit andpyedaa-reports --pytest=reduce-depth:...affect it.Unit Tests
tests/unit/UnittestPages.py:pages, an unreadable report, and the validation ofpages;clear_docandmerge_domaindata.tests/data/Report/unittest.xmlgains an error, captured standard output and standard error; newtests/data/Report/TestReport.xml.Known Issues
.. only::doesn't hold it back.Project.discover()subclass.Related Issues and Pull-Requests